# 导包
import unittest
import app
from lib.HTMLTestRunner_PY3 import HTMLTestRunner
from script.test_emp import TestEmp
from script.test_login import TestLogin

# 1. 创建测试套件对象
suite = unittest.TestSuite()

# 2. 在测试套件对象中添加测试用例的类
suite.addTest(unittest.makeSuite(TestEmp))
suite.addTest(unittest.makeSuite(TestLogin))

# 3. 指定测试报告存放的位置
report_path = app.PROJECT_PATH + "/report/report.html"

with open(report_path, mode="wb") as f:
    # 4. 实例化HTMLTestRunner对象
    runner = HTMLTestRunner(f)
    # 5. 执行测试套件
    runner.run(suite)
